/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.partaljevic.tapestry.gambling.pages;

import com.partaljevic.gambling.Customer;
import com.partaljevic.gambling.Identifiable;
import com.partaljevic.tapestry.gambling.service.Customers;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.annotations.SetupRender;
import org.apache.tapestry5.ioc.annotations.Inject;

/**
 *
 * @author Danilo
 */
public class Welcome {

    @Property
    private Customer currentCustomer;
    private long ID;
    @Persist("flash")
    private String message;
    @Inject
    private Customers customers;

    public void onActivate(long id) {
        currentCustomer = customers.retrieve(id);
    }

    public long onPassivate() {
        return ID;
    }

    public void setID(long ID) {
        this.ID = ID;
    }

    public long getID() {
        return Identifiable.class.cast(currentCustomer).getID();
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
}
